package com.yupi.project.mq.deadQueue;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

/**
 * @author <a href=""https://github.com/Fzs0>逢左使</a>
 * @create 2024/01/07 15:28
 * @Description:
 */
public class RabbitMQUtils {

    public static Channel getChannel() throws Exception {
        // 1: 创建连接工厂，设置连接属性
        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setHost("123.58.209.178");
        connectionFactory.setPort(5672);
        connectionFactory.setVirtualHost("/");
        connectionFactory.setUsername("xp");
        connectionFactory.setPassword("123456");
        Connection connection = connectionFactory.newConnection();
        return connection.createChannel();
    }

}
